//package com.fecean.aabbc.netty.handler4;
//
//import com.fecean.aabbc.netty.message4.MessageRequest;
//import com.fecean.aabbc.netty.message4.MessageResponse;
//import io.netty.channel.ChannelHandler;
//import io.netty.channel.ChannelHandlerContext;
//import io.netty.channel.SimpleChannelInboundHandler;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//
//import java.time.Instant;
//
///**
// * NettyRequestChannelHandler
// *
// * @author: chenfenghai
// * @version: 1.0
// * @date: 2020-03-05 15:59
// * @blame Team
// */
//@Slf4j
//@Component
//@ChannelHandler.Sharable
//public class NettyRequestChannelHandler extends SimpleChannelInboundHandler<MessageRequest> {
//
//    @Override
//    protected void channelRead0(ChannelHandlerContext ctx, MessageRequest messageRequest) throws Exception {
//        log.info("客户端[{}-{}]收到请求：{}",
//                messageRequest.getTenantId(), messageRequest.getCinemaCode(), messageRequest);
//
//        MessageResponse response = new MessageResponse();
//        response.setId(messageRequest.getId());
//        response.setTenantId(messageRequest.getTenantId());
//        response.setCinemaCode(messageRequest.getCinemaCode());
//        response.setTimestamp(Instant.now().toEpochMilli());
//        response.setContent("{\"result\":\"响应结果\"}");
//        ctx.writeAndFlush(response);
//
//        log.info("客户端[{}-{}]响应结果：{}",
//                response.getTenantId(), response.getCinemaCode(), response);
//    }
//}
